package com.zf.bm.common.core.sys.dao;

import com.zf.bm.common.core.base.dao.BaseDao;
import com.zf.bm.common.core.sys.entity.Role;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

/**
 * 角色DAO接口
 */
public interface RoleDao extends BaseDao<Role> {

    /**
     * 维护角色与菜单权限关系
     * @return
     */
    @Delete("DELETE FROM sys_role_menu WHERE role_id = #{id}")
    int deleteRoleMenu(Long id);

    int insertRoleMenu(Role role);

    @Select("select name,sm3 from sys_role where id = #{id}")
    Role selectNameAndSm3ById(Integer id);

}
